0002. TNotes 公式支持
1. 🎯 本节内容
- TNotes 公式支持
2. 🫧 评价
- 印象中,在早期的 vitepress 中是没有 数学公式支持 的,需要手动去引第三方的库来实现,现在已经提供了支持,需要下载一个第三方库
markdown-it-mathjax3然后开启math配置即可。 - 在 TNotes 中已经做好了必要的准备工作,加上了数学公式的支持。
3. 💻 数学公式支持测试
test 1是引用自 vitepress 官方的测试用例test 2是写 TNotes.leetcode 题解的时候经常要用到的复杂度的一些写法测试
3.1. test 1
输入
md
When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
Maxwell's equations:
| equation | description |
| --- | --- |
| $\nabla \cdot \vec{\mathbf{B}} = 0$ | divergence of $\vec{\mathbf{B}}$ is zero |
| $\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} = \vec{\mathbf{0}}$ | curl of $\vec{\mathbf{E}}$ is proportional to the rate of change of $\vec{\mathbf{B}}$ |
| $\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} = \frac{4\pi}{c}\vec{\mathbf{j}} \nabla \cdot \vec{\mathbf{E}} = 4 \pi \rho$ | _wha?_ |1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
输出
When
Maxwell's equations:
| equation | description |
|---|---|
| divergence of | |
| curl of | |
| wha? |
3.2. test 2
md
- $O(n)$
- $O(n^2)$
- $O(\log n)$1
2
3
2
3